<?php
class AdminController extends BaseController
{
	/**
	 * 展示引导页面
	 * @Author   Leikes
	 * @DateTime 2016-01-31T16:56:26+0800
	 * @return   view                   引导页面
	 */
	public function showIndex()
	{
		return View::make('admin.index');
	}

	/**
	 * 生成注册序列号
	 * @Author   Leikes
	 * @DateTime 2016-01-31T16:56:55+0800
	 * @return   json                   注册序列号
	 */
	public function createServerNumber()
	{
		$csns=new CreateServerNumberService;
		$number=$csns->createServerNumber();
		return View::make('admin.userManage.createregisternumber')->with(['number'=>$number]);
	}

	/**
	 * 生成激活码返回给用户
	 * @Author   leikes
	 * @datetime 2016-02-15T10:54:49+0800
	 * @return   json                   ['code','message']
	 */
	public function sendServerInfo()
	{
		$data=Input::all();
		$userManageService=new UserManageService;
		$errInfo=$userManageService->insertServerNumber($data);
		return Response::json($errInfo);
	}

	/**
	 * 展示全部位激活的用户
	 * @Author   Leikes
	 * @DateTime 2016-02-05T15:57:20+0800
	 * @return   view                   用户管理列表界面
	 */
	public function userList()
	{
		$userManageService=new UserManageService;
		$userList=$userManageService->findAll();
		return View::make('admin.userManage.userlist')->with(['userList'=>$userList]);
	}

	/**
	 * 展示未激活的用户信息
	 * @Author   Leikes
	 * @DateTime 2016-02-09T00:46:49+0800
	 * @return   array                   用户信息
	 */
	public function userInfo()
	{
		$data=Input::all();
		$userManageService=new UserManageService;
		$userInfo=$userManageService->findByUserInfo($data);
		return View::make('admin.userManage.userinfo')->with(['userInfo'=>$userInfo]);
	}
}
?>